<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>操作内容</button>
    <div>
        <p>文本内容1111</p>
    </div>
    
    <script>

        var ele = document.querySelector('div')
        var btn = document.querySelector('button')

        // 获取元素文本内容
        // console.log(ele.innerText);
        console.log(ele.innerHTML);

        btn.onclick = function(){
            ele.innerHTML = '<spna>新的内容</span>'
        }

    </script>
</body>
</html>